<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<style>
		.tou {
			display: -webkit-box;
			/*border: 1px solid;*/
			/*width: 100%;*/
			height: 80px;
			-webkit-box-align: center;
			background-color: #0097FF;
		}
		
		.Hui-iconfont {
			display: -webkit-box;
			margin-left: 20px;
			font-size: 30px;
			color: white;
		}
		
		.dd-div {
			/*border: 1px solid;*/
			font-weight: bolder;
			font-size: 25px;
			color: white;
			-webkit-box-flex: 1;
			display: -webkit-box;
			margin-left: ;
			-webkit-box-pack: center;
		}
		
		.zhuce {
			/*border: 1px solid;*/
			width: 60px;
			font-size: 20px;
			font-weight: bold;
		}
		
		#username,
		#pwd {
			margin-top: 20px;
			width: 100%;
			height: 40px;
			font-size: 1rem;
			text-align: center;
		}
		
		.anniu {
			display: -webkit-box;
			-webkit-box-pack: center;
			margin-top: 20px;
			
		}
		.anniu input:active{
			background-color: #777777;
		}
		.denglu {
			width: 10rem;
			height: 40px;
			font-weight: bold;
			font-size: 15px;
			background-color:#04BE02 ;
			color: white;
			border: 0px;
		}
	</style>

	<body>
		<div class="tou">
			<div> <a href="../shouye/index.html" style="text-decoration: none;"><i class="Hui-iconfont">&#xe67d</i></a></div>
			<div class="dd-div">
				<div class="ding-dan">登录</div>
			</div>
			<div class="zhuce"><a href="../zhuce/zhuce.html" style="color: white;text-decoration: none;">注册</a></div>
		</div>
		<input type="text" id="username" placeholder="用户名" />
		<input type="password" id="pwd" placeholder="密码" />
		<div class="anniu">
			<div>
				<input type="button" value="登录" onclick="login()" class="denglu" style="" /></div>
		</div>
		<!-- 引入 LeanCloud 存储 SDK -->
		<link rel="stylesheet" href="js/1.0.8/iconfont.min.css">
		<script src="av-min-2.1.2.js"></script>
		<script type="text/javascript">
			window.onload = function() {
				// 初始化存储 SDK
				var APP_ID = 'hMxRNdIevDj4IR3LHG0vJRNU-gzGzoHsz';
				var APP_KEY = 'e7oBIWOnxaDwD5yTBBRUdN4t';
				AV.init({
					appId: APP_ID,
					appKey: APP_KEY
				});
			};
			//							function login() {
			//								AV.User.login($("#username").value(), $("#pwd").value()).then(function(result) {
			//									console.log(result);
			//								}, function(error) {
			//									console.log(JSON.stringify(error));
			//								});
			//							}
			function login() {
				var username = document.getElementById("username").value;
				var pwd = document.getElementById("pwd").value;
				AV.User.logIn(username, pwd).then(function(loginedUser) {
					location.href = "../shouye/index.html"
				}, function(error) {
					alert("登录有错误")
				});
			}
		</script>
	</body>

</html>